﻿using CMS.DataAccess;
using CMS.Model;

namespace CMS.AOP
{
    public class ScheduleTemplateDefValueSetter : IDefaultValueSetter<ScheduleTemplateModel>
    {
        public void SetValue(ScheduleTemplateModel value)
        {
            var courseQry = new DbQuery<CourseModel>();
            var c = courseQry.Get(value.Course);
            value.Optional = c.Optional;
            value.Color = c.Color;
            value.Teacher = c.Teacher;
            value.GroupClass = c.GroupClass;
        }
    }
}
